//
//  OHA_PublicMethod.h
//  OneHourArrvie
//
//  Created by Sunny on 16/12/9.
//  Copyright © 2016年 Sunny. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface base_PublicMethod : NSObject

/**
 初始化Button

 @param backgroudImage  背景图
 @param highImage       选中的背景图
 @param backgroundColor 背景色
 @param title           显示的字
 @param textcolor       字体颜色
 @param font            字体大小
 @param addView            button要添加的view
 @param target          self
 @param action          要触发的方法

 @return button
 */
+(UIButton *)creatButtonWithBackgroundImage:(NSString *)backgroudImage WithBackgroundHighImage:(NSString *)highImage WithBackgroundColor:(UIColor *)backgroundColor WithTitle:(NSString *)title WithTextColor:(UIColor *)textcolor  WithtextFont:(UIFont *)font WithaddView:(UIView *)addView Withtarget:(id)target Withaction:(SEL)action;

+(UIButton *)creatButtonWithBackgroundImage:(NSString *)image WithaddView:(UIView *)addView Withtarget:(id)target Withaction:(SEL)action;

+(UIButton *)creatButtonWithTitle:(NSString *)title WithTextFont:(UIFont *)font WithTitleColor:(UIColor *)textcolor WithBackgroundColor:(UIColor *)backgroundColor WithAddView:(UIView *)addView WithTarget:(id)target WithAction:(SEL)action;

/**
 初始化Label

 @param text            内容
 @param font            字体大小
 @param color           字体颜色
 @param count           字体对齐方式
 @param backgroundColor 背景色
 @param addView            label要添加的view
 @param lines           行数

 @return label
 */
+(UILabel *)creatLabelWithText:(NSString *)text WithFont:(UIFont *)font WithTextColor:(UIColor *)color WithTextAlignment:(NSInteger)count WithBackgroundColor:(UIColor *)backgroundColor WithAddView:(UIView *)addView WithnumberOfLines:(NSInteger)lines;


/**
 初始化View

 @param color   背景色
 @param addView view要textFiled添加的父视图

 @return view
 */
+(UIView *)creatViewWithBackgroundColor:(UIColor *)color WithAddView:(UIView *)addView;


/**
 初始化TextField

 @param placeholder 占位符
 @param font        字体大小
 @param count       清除按钮
 @param addView     textFiled要添加的父视图

 @return textFiled
 */
+(UITextField *)creatTextFieldWithPlaceHolder:(NSString *)placeholder  WithTextFont:(UIFont *)font WithTextClearButtonMode:(NSInteger )count WithAddView:(UIView *)addView;


/**
  初始化imageView

 @param imageName 图片名
 @param addView   imageView要添加的父视图

 @return imageView
 */
+(UIImageView *)creatImageViewWithImage:(NSString *)imageName  WithAddView:(UIView *)addView;


+(void)setTextColor:(UILabel *)label AndRange:(NSRange)range AndColor:(UIColor *)color;
+(NSMutableAttributedString *)OHA_setTextColor:(NSString *)label AndRange:(NSRange)range AndColor:(UIColor *)color;
+(void)setTextFont:(UILabel *)label AndRange:(NSRange)range AndFont:(UIFont *)font;




@end
